package com.ylfstu.list_;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListExercise {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            list.add("hello");
        }
        System.out.println(list);
        list.add(1, "杨凌飞学java");
        System.out.println(list.get(4));
        list.remove(5);
        list.set(6, "java");
        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
            Object obj = iterator.next();
            System.out.print(obj + " ");
        }

    }
}
